﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebmasterTool/Admin.Master" AutoEventWireup="true"
    CodeBehind="SlideShow.aspx.cs" Inherits="Framework.WebmasterTool.SlideShow" %>

<%@ Register Src="../Controls/simpleImageUploadUserControl/SimpleImageUpload.ascx" TagName="SimpleImageUpload"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $(".deleteImage").live("click", function () {
                var callFrom = $(this);
                jConfirm('Chắc chắn xoá?', 'Digisky Confirm Dialog',
                            function (r) {
                                if (r) {
                                    __doPostBack(callFrom.attr('id').replace(/_/g, '$'), '');
                                }
                            });
                return false;
            });
        });
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#spanClearDateFrom").click(function () {
                $("#<%= txtRealeaseDate.ClientID %>").val("");
            });
            $("#spanClearDateTo").click(function () {
                $("#<%= txtExpireDate.ClientID %>").val("");
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ctlCaption" runat="Server">
    Quản lý slide show
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageContent" runat="Server">
    <asp:Label ID="lblPermissionMessage" runat="server" Font-Bold="true" ForeColor="Red"
        Text="Tài khoản không có quyền truy cập vào trang này" Visible="false"></asp:Label>
    <asp:Panel ID="Panel1" runat="server" Visible="true">
        <table border="0" align="center" width="100%">
            <tr>
                <td align="center">
                    <br />
                    <asp:ValidationSummary ID="ValidationSummary1" runat="server" ValidationGroup="Banner"
                        Font-Bold="true" DisplayMode="List" />
                    <asp:Label runat="server" ID="lblMsg" Font-Bold="true" ForeColor="blue"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <table width="100%">
                        <tr>
                            <td align="right" style="width: 120px;">
                                Tên hình tiếng việt:
                            </td>
                            <td>
                                <asp:TextBox ID="txtImageTitle" runat="server" Width="630"></asp:TextBox>
                            </td>
                        </tr>
                        <tr runat="server" visible="true">
                            <td align="right">
                                Tên hình tiếng anh:
                            </td>
                            <td>
                                <asp:TextBox ID="txtImageTitle_en" runat="server" Width="630"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                Thuộc tính alt:
                            </td>
                            <td>
                                <asp:TextBox ID="txtImageAlt" runat="server" Width="630"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                Mô tả:
                            </td>
                            <td>
                                <CKEditor:CKEditorControl ID="txtDescription" runat="server" UIColor="#CED9F3" Toolbar="Basic"
                                    BasePath="/Plugins/Ckeditor" ContentsCss="/Plugins/Ckeditor/contents.css" TemplatesFiles="/Plugins/Ckeditor/plugins/templates/templates/default.js">
                                </CKEditor:CKEditorControl>
                            </td>
                        </tr>
                        <tr runat="server" visible="true">
                            <td align="right">
                                Mô tả(en):
                            </td>
                            <td>
                                <CKEditor:CKEditorControl ID="txtDescription_en" runat="server" UIColor="#CED9F3"
                                    Toolbar="Basic" BasePath="/Plugins/Ckeditor" ContentsCss="/Plugins/Ckeditor/contents.css"
                                    TemplatesFiles="/Plugins/Ckeditor/plugins/templates/templates/default.js">
                                </CKEditor:CKEditorControl>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                Danh mục slide show:
                            </td>
                            <td>
                                <asp:DropDownList ID="ddlCateSlide" runat="server" Width="636" AppendDataBoundItems="true">
                                    <asp:ListItem Text="Trang chủ" Value="0"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                Link liên kết:
                            </td>
                            <td>
                                <asp:TextBox ID="txtImageLink" runat="server" Visible="true" Width="630"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                    <ContentTemplate>
                                        <asp:CheckBox ID="chkWatermarkImage" runat="server" Text="Chèn chữ ký:" AutoPostBack="true"
                                            OnCheckedChanged="chkWatermarkImage_CheckedChanged" />
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                            </td>
                            <td>
                                <uc1:SimpleImageUpload ID="siuImage" runat="server" CssClass="ImageUpload" AutoOpenImageEditPopupAfterUpload="true" />
                                <br />
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                Vị trí:
                            </td>
                            <td>
                                <asp:TextBox ID="txtDisplayOrder" runat="server" Visible="true" Width="630" Text="0"></asp:TextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Chưa nhập vị trí cho slide show - banner"
                                    ControlToValidate="txtDisplayOrder" ValidationGroup="Banner" Display="Dynamic">*</asp:RequiredFieldValidator>
                                <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txtDisplayOrder"
                                    Type="Integer" MinimumValue="0" MaximumValue="9999" ValidationGroup="Banner"
                                    ErrorMessage="Vị trí slide show - banner phải từ 0 đến 9999" Display="Dynamic">*</asp:RangeValidator>
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                            </td>
                            <td align="left">
                                Ngày đăng:
                                <asp:TextBox ID="txtRealeaseDate" runat="server" Width="200"></asp:TextBox>
                                <AjaxControlToolkit:CalendarExtender ID="CalendarExtender1" Format="dd/MM/yyyy hh:mm:ss tt"
                                    runat="server" TargetControlID="txtRealeaseDate">
                                </AjaxControlToolkit:CalendarExtender>
                                <AjaxControlToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" MaskType="DateTime"
                                    ClearMaskOnLostFocus="true" TargetControlID="txtRealeaseDate" AcceptAMPM="true"
                                    Mask="99/99/9999 99:99:99" AutoComplete="false" InputDirection="LeftToRight"
                                    ErrorTooltipEnabled="true" MessageValidatorTip="true">
                                </AjaxControlToolkit:MaskedEditExtender>
                                <AjaxControlToolkit:MaskedEditValidator ID="MaskedEditValidator1" runat="server"
                                    ValidationGroup="ArticleAdd" ControlToValidate="txtRealeaseDate" ControlExtender="MaskedEditExtender1"
                                    EmptyValueBlurredText="*" InvalidValueBlurredMessage="*" InvalidValueMessage="Sai định dạng ngày tháng năm giờ phút giây"
                                    IsValidEmpty="true"> 
                                </AjaxControlToolkit:MaskedEditValidator>
                                <span id="spanClearDateFrom" style="cursor: pointer;">[x]</span> Ngày hết hạn:
                                <asp:TextBox ID="txtExpireDate" runat="server" Width="200"></asp:TextBox>
                                <AjaxControlToolkit:CalendarExtender ID="CalendarExtender2" Format="dd/MM/yyyy hh:mm:ss tt"
                                    runat="server" TargetControlID="txtExpireDate">
                                </AjaxControlToolkit:CalendarExtender>
                                <AjaxControlToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server" MaskType="DateTime"
                                    ClearMaskOnLostFocus="true" TargetControlID="txtExpireDate" AcceptAMPM="true"
                                    Mask="99/99/9999 99:99:99" AutoComplete="false" InputDirection="LeftToRight"
                                    ErrorTooltipEnabled="true" MessageValidatorTip="true">
                                </AjaxControlToolkit:MaskedEditExtender>
                                <AjaxControlToolkit:MaskedEditValidator ID="MaskedEditValidator2" runat="server"
                                    ValidationGroup="ArticleAdd" ControlToValidate="txtExpireDate" ControlExtender="MaskedEditExtender2"
                                    EmptyValueBlurredText="*" InvalidValueBlurredMessage="*" InvalidValueMessage="Sai định dạng ngày tháng năm giờ phút giây"
                                    IsValidEmpty="true"> 
                                </AjaxControlToolkit:MaskedEditValidator>
                                <span id="spanClearDateTo" style="cursor: pointer;">[x]</span>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="center">
                                <asp:Button ID="btnImageSave" runat="server" Text=" Lưu " Width="80" OnClick="btnImageSave_Click"
                                    ValidationGroup="Banner" />
                                <asp:Button ID="btnImageCancel" runat="server" Visible="false" Width="80" Text=" Hủy "
                                    OnClick="btnImageCancel_Click" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center">
                    <asp:DataList ID="dtlImage" runat="server" RepeatDirection="Horizontal" RepeatColumns="3"
                        Width="100%">
                        <ItemTemplate>
                            <table border="0" style="width: 260px;">
                                <tr>
                                    <td bgcolor="white" align="center" style="width: 100%; height: 100px">
                                        <img style="border: solid 2px white; width: 150px; max-height: 90px;" src='<%# DGSFramework.Globals.ApplicationPath + "UserUpload/Banners/" + Eval("src") %>'
                                            alt="" />
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" style="padding-top: 3pt; padding-bottom: 10px;" valign="top">
                                        <table>
                                            <tr>
                                                <td>
                                                    Tên tiếng việt:
                                                </td>
                                                <td>
                                                    <%# Eval("title")%>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    Loại danh mục:
                                                </td>
                                                <td>
                                                    <%# Eval("cateName")%>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    Vị trí:
                                                </td>
                                                <td>
                                                    <%# Eval("index")%>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td colspan="2" align="center">
                                                    <asp:LinkButton ID="lkbDeleteImage" runat="server" Text="[Xoá]" CssClass="deleteImage"
                                                        CommandArgument='<%# Eval("id") %>' OnClick="lkbDeleteImage_Click"></asp:LinkButton>
                                                    <a href="SlideShow.aspx?Image=<%# Eval("id") %>">[Sửa]</a>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </ItemTemplate>
                    </asp:DataList>
                    <CollectionPager:CollectionPager ID="clpImage" runat="server" ControlCssClass="phantrang"
                        BackNextLocation="Split" LabelText="" PagingMode="PostBack" ResultsFormat=""
                        FirstText="<<" BackText="<" NextText=">" LastText=">>" PageSize="9" ShowFirstLast="True">
                    </CollectionPager:CollectionPager>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
